﻿using System;
using System.Data;
using InfoSoftGlobal;

public partial class TestChart : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //FCLiteral.Text = CreateChart();
        int x=3;
        FCLiteral.Text = ((++x) + (++x)).ToString();
    }

    private string CreateChart()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("years", typeof(string));
        dt.Columns.Add("value", typeof(string));
        for (int i = 1; i <= 6; i++)
        {
            DataRow dr = dt.NewRow();
            dr["years"] = "20100" + i;
            dr["value"] = (i * 10).ToString();
            dt.Rows.Add(dr);
        }
        string strXML;
        strXML = "<graph caption='Factory Output report' subCaption='By Quantity' decimalPrecision='0' showNames='1'  numberSuffix=' Units'  pieSliceDepth='30' formatNumberScale='0'>";
        for (int j = 0; j < dt.Rows.Count; j++)
        {
            strXML += "<set name='" + dt.Rows[j]["years"].ToString() + "' value='" + dt.Rows[j]["value"].ToString() + "' />";

        }
        strXML += "</graph>";
        return FusionCharts.RenderChart("FusionCharts/FCF_StackedColumn3D.swf", "", strXML, "FactorySum", "650", "450", false, false);
    }
}
